package com.woniuxy.service.impl;

import com.woniuxy.entity.Mail;
import com.woniuxy.service.ProducerConsumserService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: 马宇航
 * @Description: TODO
 * @DateTime: 22/10/19/0019 16:46
 * @Component: 成都蜗牛学苑
 **/
@Service
public class ProducerConsumserServiceImpl implements ProducerConsumserService {
    @Autowired
    RabbitTemplate rabbitTemplate;
    @Override
    public void sendEmail(String queueName, Mail mail) {
        //设置发送的消息
        rabbitTemplate.convertAndSend(queueName,mail);
    }
}
